/*
 * LoadReport.java
 *
 * Created on 20 de Mar�o de 2003, 20:43
 */

import java.io.*;
import saci.reptil.ReportManager;
import saci.reptil.reader.XmlReader;

/**
 *
 * @author  saci
 */
public class LoadReport {

    public static void main(String[] args) {
        if (args.length == 1) {
            try {
                BufferedReader in = new BufferedReader(new FileReader(args[0]));
                String s, xml = "";

                while ((s = in.readLine()) != null) {
                    xml += s;
                }

                XmlReader xmlReader = new XmlReader(xml);

                ReportManager rp = new ReportManager(xmlReader);
                rp.prepare();
                in.close();

                rp.show("Report");
                /*PdfExporter e = new PdfExporter(rp, "e:\\temp\\teste.pdf");
                e.save();
                System.out.println("fim");*/
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            System.out.println("Invalid arguments.\nusage: java LoadReport \"path/file.xml\"");
        }
    }
}
